package com.xizi.lotterySystem.controller;

import com.xizi.lotterySystem.common.pojo.CommonResult;
import com.xizi.lotterySystem.service.IPictureService;
import com.xizi.lotterySystem.service.Impl.PictureServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


//图片模块
@RestController
@RequestMapping("/picture")
public class PictureController {
    @Autowired
    private IPictureService pictureService;

    /**
     * 图片上传
     *
     * @param file
     * @return
     */
    @RequestMapping("/pictureUpload")
    public CommonResult<String> uploadPicture(MultipartFile file) {
        String path = pictureService.savePicture(file);
        return CommonResult.success(path);
    }

}
